import request from '@/utils/request'

// 获取策略列表
export const getPolicyList = (params) => {
  return request.get('/admin/policy/page', { params })
}

// 新增策略
export const addPolicy = (data) => {
  return request.post('/admin/policy', data)
}

// 更新策略
export const updatePolicy = (data) => {
  return request.put('/admin/policy', data)
}

// 删除策略
export const deletePolicy = (id) => {
  return request.delete(`/admin/policy/${id}`)
}

// 修改策略状态
export const changePolicyStatus = (id, status) => {
  return request.post(`/admin/policy/status/${status}`, null, {
    params: { id }
  })
}
